package com.itheima.alioss;


import org.springframework.boot.context.properties.EnableConfigurationProperties;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/*
    这要做一个配置类
        只有一个目标，
            1. 就是要把AliOSSProperties 交给IOC容器管理！
                @EnableConfigurationProperties(AliOSSProperties.class)
            2. 还要把AliOSSUtils 交给IOC容器管理！
                @Bean

 */
@EnableConfigurationProperties(AliOSSProperties.class)
@Configuration
public class AliOSSAutoConfigure {

    @Bean
    public AliOSSUtils utils(AliOSSProperties properties){
        AliOSSUtils ossUtils = new AliOSSUtils();
        ossUtils.setAli(properties);
        return ossUtils;
    }
}
